﻿<UserControl x:Class="RDVCommentWidget.View.StylePanel"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c1ext="clr-namespace:C1.Silverlight.Extended;assembly=C1.Silverlight.Extended.5"
    xmlns:c1="clr-namespace:C1.Silverlight;assembly=C1.Silverlight.5"
    xmlns:util="clr-namespace:SLB.InterACT.VisualizationTool.Common.Utilities;assembly=SLB.InterACT.VisualizationTool.Common"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="350">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/SLB.InterACT.VisualizationTool.Common;component/Resources/VisualizationToolAsserts.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <util:ByteArrayToImageConverter x:Name="ByteArrayToImage" />
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid x:Name="StyleRoot" Grid.Row="0" Grid.Column="1" Width="340">
        <Grid.RowDefinitions>
            <RowDefinition Height="5"></RowDefinition>
            <RowDefinition Height="0"></RowDefinition>
            <RowDefinition Height="20"></RowDefinition>
            <RowDefinition Height="50"></RowDefinition>
            <RowDefinition Height="0"></RowDefinition>
            <RowDefinition Height="0"></RowDefinition>
            <RowDefinition Height="0"></RowDefinition>
            <RowDefinition Height="0"></RowDefinition>
            <RowDefinition Height="15"></RowDefinition>
            <RowDefinition Height="50"></RowDefinition>
            <RowDefinition Height="0"></RowDefinition>
            <RowDefinition Height="15"></RowDefinition>
            <RowDefinition Height="0"></RowDefinition>
            <RowDefinition Height="30"></RowDefinition>
            <RowDefinition Height="0"></RowDefinition>
            <RowDefinition Height="15"></RowDefinition>
            <RowDefinition Height="0" ></RowDefinition>
            <RowDefinition Height="30"></RowDefinition>
            <RowDefinition Height="0"></RowDefinition>
            <RowDefinition Height="15"></RowDefinition>
            <RowDefinition Height="0"></RowDefinition>
            <RowDefinition Height="30" ></RowDefinition>
            <RowDefinition Height="5"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0"></ColumnDefinition>
            <ColumnDefinition Width="78"></ColumnDefinition>
            <ColumnDefinition Width="20*"></ColumnDefinition>
            <ColumnDefinition Width="25*"></ColumnDefinition>
            <ColumnDefinition Width="30*"></ColumnDefinition>
            <ColumnDefinition Width="0"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Button Content="Copy from Normal" Grid.Row="1" Grid.Column ="1" Grid.ColumnSpan="4" HorizontalAlignment="Left" Height="20" Width="130" FontSize="11" Margin="2,0,2,0" x:Name="CopySettings" Click="CopySettings_Click"></Button>
        <StackPanel Grid.Row="2" Grid.Column ="1" Grid.ColumnSpan="4"  FlowDirection="LeftToRight" Orientation="Horizontal"  Margin="0,0,0,0">
            <Border BorderThickness="5" Width="5" Height="2" Margin="0,6,3,6" BorderBrush="#FFE7E7E7"></Border>
            <TextBlock  Text="Inset"  Margin="0,2,0,0" Style="{StaticResource TextStyle}" FontWeight="Bold"></TextBlock>
            <Border BorderThickness="5" Width="500" Height="2" Margin="3,6,6,6" BorderBrush="#FFE7E7E7"></Border>
        </StackPanel>
        <Grid Grid.Row="3" Grid.Column ="1" Grid.ColumnSpan="4">
            <c1ext:C1ColorPicker Height="25" Width="40" HorizontalAlignment="Left" Margin="20,15,0,10" SelectedBrush="{Binding BackgroundBrush, Mode=TwoWay}"  />
            <Border BorderBrush="Gray"  BorderThickness="1" Margin="74,13,0,7" Width="42" HorizontalAlignment="Left">
                <HyperlinkButton x:Name="NormalSelectImage" ToolTipService.ToolTip="Click to select image" CommandParameter="Normal"  Click="SelectImageButton_Click" Background="#FFC6C6C6" >
                    <Image x:Name="Label_Thumbnail" Stretch="Fill" Margin="-1,1,1,1" Source="{Binding BackgroundImageStream, ConverterParameter=bgImage, Converter={StaticResource ByteArrayToImage}}"  />
                </HyperlinkButton>
            </Border>
            <Grid Margin="125,8,100,2">
                <StackPanel  Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Center">
                    <TextBlock Text="Transparency"  Height="18" Width="75"  FontSize="10"/>
                    <TextBlock Text="{Binding Value, ElementName=ImageTranparency}" FontSize="10"/>
                    <TextBlock Text="%" FontSize="10"/>
                </StackPanel>
                <Slider  Minimum="0" Maximum="100" FlowDirection="LeftToRight"  x:Name="ImageTranparency"  Margin="3,12,2,11" Value="{Binding ImageTransparency, Mode=TwoWay}" Style="{StaticResource TransparancySlider}" />
                <TextBlock Text="0"  Margin="0,27,107,0" HorizontalAlignment="Right" RenderTransformOrigin="13.95,2.324" FontSize="8"/>
                <TextBlock Text="100" VerticalAlignment="Bottom" HorizontalAlignment="Right" FontSize="8" RenderTransformOrigin="0.333,0.4" Margin="0,0,5,1"/>
            </Grid>

            <CheckBox IsChecked="{Binding IsHideImage, Mode=TwoWay}" HorizontalAlignment="Right" Width="84" Margin="0,7,10,0" Height="18" VerticalAlignment="Top" Style="{StaticResource DisplayCheckboxTextStyle}">Hide Image</CheckBox>
            <CheckBox IsChecked="{Binding IsStretchImage, Mode=TwoWay}" HorizontalAlignment="Right" Width="84" Margin="0,0,10,4" Height="19" VerticalAlignment="Bottom" Style="{StaticResource DisplayCheckboxTextStyle}">Stretch</CheckBox>
        </Grid>

        <StackPanel Grid.Row="8" Grid.Column ="1" Grid.ColumnSpan="4"  FlowDirection="LeftToRight" Orientation="Horizontal"  Margin="0,0,0,0">
            <Border BorderThickness="5" Width="5" Height="2" Margin="0,6,3,6" BorderBrush="#FFE7E7E7"></Border>
            <TextBlock  Text="Frame"  Margin="0,2,0,0" Style="{StaticResource TextStyle}" FontWeight="Bold"></TextBlock>
            <Border BorderThickness="5" Width="500" Height="2" Margin="3,6,6,6" BorderBrush="#FFE7E7E7"></Border>
        </StackPanel>

        <Grid Grid.Row="9" Grid.Column ="1" Grid.ColumnSpan="4">
            <c1ext:C1ColorPicker  Height="25" Width="40" HorizontalAlignment="Left" Margin="20,12,0,13"   SelectedBrush="{Binding FrameBrush, Mode=TwoWay}"  />
            <StackPanel Margin="75,8,100,11" Orientation="Horizontal">
                <RadioButton GroupName="NormalBorderStyle"  IsChecked="{Binding RectangleBorder, Mode=TwoWay}" Margin="0,7,0,8">
                    <Image Source="/RDVCommentWidget;component/Images/shareboarder.png" />
                </RadioButton>
                <RadioButton GroupName="NormalBorderStyle" IsChecked="{Binding RoundedBorder, Mode=TwoWay}" Margin="20,7,0,8">
                    <Image Source="/RDVCommentWidget;component/Images/curveborder.png" />
                </RadioButton>
                <RadioButton GroupName="NormalBorderStyle"  IsChecked="{Binding NoBorder, Mode=TwoWay}" Margin="20,7,0,8">
                    <Image Source="/RDVCommentWidget;component/Images/noboarder.png" />
                </RadioButton>
            </StackPanel>

            <CheckBox  IsChecked="{Binding IsFrame, Mode=TwoWay}" HorizontalAlignment="Right" Width="84" Margin="0,7,10,0" Height="18" VerticalAlignment="Top" Style="{StaticResource DisplayCheckboxTextStyle}">Framed</CheckBox>
            <CheckBox IsChecked="{Binding IsGradient, Mode=TwoWay}" HorizontalAlignment="Right" Width="84" Margin="0,0,10,4" Height="19" VerticalAlignment="Bottom" Style="{StaticResource DisplayCheckboxTextStyle}">Gradient</CheckBox>
        </Grid>

        <StackPanel Grid.Row="11" Grid.Column ="1" Grid.ColumnSpan="4"  FlowDirection="LeftToRight" Orientation="Horizontal"  Margin="0,0,0,0">
            <Border BorderThickness="5" Width="5" Height="2" Margin="0,6,3,6" BorderBrush="#FFE7E7E7"></Border>
            <TextBlock  Text="Label"  Margin="0,2,0,0" Style="{StaticResource TextStyle}" FontWeight="Bold"></TextBlock>
            <Border BorderThickness="5" Width="500" Height="2" Margin="6,6,6,6" BorderBrush="#FFE7E7E7"></Border>
        </StackPanel>

        <StackPanel  Grid.Row="13" Grid.Column="1" Grid.ColumnSpan="4"    FlowDirection="LeftToRight" Orientation="Horizontal"  Margin="0,0,0,0">


            <ComboBox Height="20" Width="130" FontSize="11" Margin="5,0,2,0" ItemsSource="{StaticResource FontFamilyList}" SelectedValuePath="Value" SelectedValue="{Binding Path=Label.FontFamilyString, Mode=TwoWay}"   DisplayMemberPath="Key" Style="{StaticResource ComboboxTextStyle}"></ComboBox>
            <ComboBox  Height="20" Width="57" Margin="0,0,2,0" ItemsSource="{StaticResource FontSizeList}"  SelectedValuePath="Key" SelectedValue="{Binding Path=Label.FontSize, Mode=TwoWay}"   DisplayMemberPath="Key" Style="{StaticResource ComboboxTextStyle}"></ComboBox>
            <c1ext:C1ColorPicker Width="35" Height="20"  Margin="0 0 2 0" SelectedBrush="{Binding Path=Label.ColorBrush , Mode=TwoWay}" />

            <ToggleButton Width="20" Height="20" Margin="0 0 0 0" x:Name="Label_Bold" IsChecked="{Binding Label.IsBold, Mode=TwoWay}" Style="{StaticResource ToggleButtonStyle}">
                <ToggleButton.Content>
                    <Image x:Name="Label_Bold_Image" ></Image>
                </ToggleButton.Content>
            </ToggleButton>
            <ToggleButton Width="20" Height="20" Margin="0 0 0 0" x:Name="Label_Italic" IsChecked="{Binding Label.IsItalic, Mode=TwoWay}" Style="{StaticResource ToggleButtonStyle}"  >
                <ToggleButton.Content>
                    <Image x:Name="Label_Italic_Image" ></Image>
                </ToggleButton.Content>
            </ToggleButton>
            <ToggleButton Width="20" Height="20" Margin="0 0 0 0" x:Name="Label_UnderLine" IsChecked="{Binding Label.IsUnderLine, Mode=TwoWay}" Style="{StaticResource ToggleButtonStyle}">
                <ToggleButton.Content>
                    <Image x:Name="Label_UnderLine_Image" ></Image>
                </ToggleButton.Content>
            </ToggleButton>

            <ComboBox x:Name="LabelAlignment" Margin="2 0 0 0" Width="30" Height="20" SelectedValuePath="Alignment" SelectedValue="{Binding Label.Alignment, Mode=TwoWay}" Style="{StaticResource ImageComboStyle}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <Image Source="{Binding Path=ImageURL}" Width="20" Height="20" Margin="-3 -1 0 0" />
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
        </StackPanel>

        <StackPanel Grid.Row="15" Grid.Column ="1" Grid.ColumnSpan="4"  FlowDirection="LeftToRight" Orientation="Horizontal"  Margin="0,0,0,0">
            <Border BorderThickness="5" Width="5" Height="2" Margin="0,6,3,6" BorderBrush="#FFE7E7E7"></Border>
            <TextBlock  Text="Value"  Margin="0,2,0,0" Style="{StaticResource TextStyle}" FontWeight="Bold"></TextBlock>
            <Border BorderThickness="5" Width="500" Height="2" Margin="6,6,6,6" BorderBrush="#FFE7E7E7"></Border>
        </StackPanel>

        <StackPanel  Grid.Row="17" Grid.Column="1" FlowDirection="LeftToRight" Grid.ColumnSpan="4"   Orientation="Horizontal"  Margin="0,0,0,0">

            <ComboBox   Height="20" Width="130" FontSize="11" Margin="5,0,2,0" ItemsSource="{StaticResource FontFamilyList}" SelectedValuePath="Value" SelectedValue="{Binding Path=Value.FontFamilyString, Mode=TwoWay}"   DisplayMemberPath="Key" Style="{StaticResource ComboboxTextStyle}"></ComboBox>
            <ComboBox  Height="20" Width="57" Margin="0,0,2,0" ItemsSource="{StaticResource FontSizeList}" SelectedValuePath="Key" SelectedValue="{Binding Path=Value.FontSize, Mode=TwoWay}"   DisplayMemberPath="Key" Style="{StaticResource ComboboxTextStyle}"></ComboBox>
            <c1ext:C1ColorPicker Width="35" Height="20"  Margin="0 0 2 0" SelectedColor="{Binding Path=Value.PureColor , Mode=TwoWay}" />

            <ToggleButton Width="20" Height="20" Margin="0 0 0 0" x:Name="Value_Bold" IsChecked="{Binding Value.IsBold, Mode=TwoWay}" Style="{StaticResource ToggleButtonStyle}">
                <ToggleButton.Content>
                    <Image  x:Name="Value_Bold_Image" ></Image>
                </ToggleButton.Content>
            </ToggleButton>
            <ToggleButton Width="20" Height="20" Margin="0 0 0 0" x:Name="Value_Italic" IsChecked="{Binding Value.IsItalic, Mode=TwoWay}" Style="{StaticResource ToggleButtonStyle}">
                <ToggleButton.Content>
                    <Image  x:Name="Value_Italic_Image" ></Image>
                </ToggleButton.Content>
            </ToggleButton>
            <ToggleButton Width="20" Height="20" Margin="0 0 0 0" x:Name="Value_UnderLine" IsChecked="{Binding Value.IsUnderLine, Mode=TwoWay}" Style="{StaticResource ToggleButtonStyle}">
                <ToggleButton.Content>
                    <Image  x:Name="Value_UnderLine_Image" ></Image>
                </ToggleButton.Content>
            </ToggleButton>




            <ComboBox x:Name="ValueAlignment" Margin="2 0 0 0" Width="30" Height="20" SelectedValuePath="Alignment" SelectedValue="{Binding Value.Alignment, Mode=TwoWay}" Style="{StaticResource ImageComboStyle}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <Image Source="{Binding Path=ImageURL}" Width="20" Height="20" Margin="-3 -1 0 0"/>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>


        </StackPanel>

        <StackPanel Grid.Row="19" Grid.Column ="1" Grid.ColumnSpan="4"  FlowDirection="LeftToRight" Orientation="Horizontal"  Margin="0,0,0,0">
            <Border BorderThickness="5" Width="5" Height="2" Margin="0,6,3,6" BorderBrush="#FFE7E7E7"></Border>
            <TextBlock  Text="Unit"  Margin="0,2,0,0" Style="{StaticResource TextStyle}" FontWeight="Bold"></TextBlock>
            <Border BorderThickness="5" Width="500" Height="2" Margin="6,6,6,6" BorderBrush="#FFE7E7E7"></Border>
        </StackPanel>

        <StackPanel  Grid.Row="21" Grid.Column="1" Grid.ColumnSpan="4"    FlowDirection="LeftToRight" Orientation="Horizontal"  Margin="0,0,0,0">

            <ComboBox   Height="20" Width="130" FontSize="11" Margin="5,0,2,0" ItemsSource="{StaticResource FontFamilyList}" SelectedValuePath="Value" SelectedValue="{Binding Path=Unit.FontFamilyString, Mode=TwoWay}"   DisplayMemberPath="Key" Style="{StaticResource ComboboxTextStyle}"></ComboBox>
            <ComboBox  Height="20" Width="57" Margin="0,0,2,0" ItemsSource="{StaticResource FontSizeList}" SelectedValuePath="Key" SelectedValue="{Binding Path=Unit.FontSize, Mode=TwoWay}"   DisplayMemberPath="Key" Style="{StaticResource ComboboxTextStyle}"></ComboBox>
            <c1ext:C1ColorPicker Width="35" Height="20"  Margin="0 0 2 0" SelectedColor="{Binding Path=Unit.PureColor , Mode=TwoWay}" />

            <ToggleButton Width="20" Height="20" Margin="0 0 0 0" x:Name="Unit_Bold" IsChecked="{Binding Unit.IsBold, Mode=TwoWay}" Style="{StaticResource ToggleButtonStyle}">
                <ToggleButton.Content>
                    <Image x:Name="Unit_Bold_Image" ></Image>
                </ToggleButton.Content>
            </ToggleButton>
            <ToggleButton Width="20" Height="20" Margin="0 0 0 0" x:Name="Unit_Italic" IsChecked="{Binding Unit.IsItalic, Mode=TwoWay}" Style="{StaticResource ToggleButtonStyle}">
                <ToggleButton.Content>
                    <Image x:Name="Unit_Italic_Image" ></Image>
                </ToggleButton.Content>
            </ToggleButton>
            <ToggleButton Width="20" Height="20" Margin="0 0 0 0" x:Name="Unit_UnderLine" IsChecked="{Binding Unit.IsUnderLine, Mode=TwoWay}" Style="{StaticResource ToggleButtonStyle}">
                <ToggleButton.Content>
                    <Image x:Name="Unit_UnderLine_Image" ></Image>
                </ToggleButton.Content>
            </ToggleButton>

            <ComboBox x:Name="UnitAlignment" Margin="2 0 0 0" Width="30" Height="20" SelectedValuePath="Alignment" SelectedValue="{Binding Unit.Alignment, Mode=TwoWay}" Style="{StaticResource ImageComboStyle}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <Image Source="{Binding Path=ImageURL}" Width="20" Height="20" Margin="-3 -1 0 0"/>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>



        </StackPanel>
    </Grid>

</UserControl>
